#define _CRT_SECURE_NO_WARNINGS
#pragma once
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
typedef int HeapDataType;
typedef struct Heap {
	HeapDataType* a;
	int size;
	int capacity;
}Hp;
void Swap(int* a, int* b);

void AdjustUp(HeapDataType* a, int child);

void HeapPrint(Hp* hp);

void HeapDestory(Hp* hp);

void HeapInit(Hp* hp);

void Heappush(Hp* hp, HeapDataType x);

void AdjustDown(HeapDataType* a, int n, int parent);

void HeapPop(Hp* hp);

HeapDataType HeapTop(Hp* hp);

void HeapCreat(Hp* hp, HeapDataType* a, int n);

void HeapTopk2(Hp* hp, int k);

void HeapSort(Hp* hp, HeapDataType* a, int n);
void HeapTopk2(Hp* hp, int k);
